home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
ndr2.exe
/
SAMPLE.ASM
< prev
next >
Wrap
Assembly Source File
|
1993-09-02
|
5KB
|
160 lines
;════════════════════════════════════════════════════════════════════════════
;The following code was taken from the Network Developer's Resource, published
;by RoseWare. All contents are Copyright (c) 1993, RoseWare. All Rights
;Reserved.
;
;This material is made available as a service for subscribers of the Network
;Developer's Resource. This material is not public domain. Simply put, if
;you are not a subscriber of the Network Developer's Resource, you are using
;this material illegally.
;
;Those interested in subscribing should contact RoseWare via:
;
;CompuServe: 76711,110
;Internet: 76711.110@compuserve.com
;Phone: (703) 799-2509
;Fax: (703) 799-8041
;US Mail: P.O. Box 257
; Mount Vernon, VA 22121-0257
;
;Also see the file SUBSCRIB.TXT in this ZIP file...
;
;Contents:
;
;Excerpts from Grant Echols' article "Dealing with the DOS Requester" in the
;September/October '93 issue of the Network Developer's Resource. See text
;for explanation of the code.
;
;════════════════════════════════════════════════════════════════════════════
; File : SAMPLE.ASM
; Author : Grant Echols
; Purpose : Demonstrate the method of interacting with the NetWare DOS
; Requester
; Build : TASM SAMPLE
; TLINK SAMPLE
; or
; MASM SAMPLE
; LINK SAMPLE
; Usage : SAMPLE
; (C) Copyright Grant Echols. All Rights Reserved.
;════════════════════════════════════════════════════════════════════════════
LF equ 10
CR equ 13
DOS_PRINT_STRING equ 09h ;DOS print string function
DOS_TERMINATE equ 4Ch ;DOS terminate application function
VLM_INT2F_QUERY equ 7A20h ;Int 2Fh to find VLM manager VLM.EXE
GET_VLM_CALL equ 0000h ; BX for _VlmCall
VLM_ID_REDIR equ 0040h ;REDIR.VLM identification number
VLM_NOTIFY equ 0001h ;Notify function
GEN_VER equ 0000h ; Version sub-function
;════════════════════════════════════════════════════════════════════════════
; DSeg - Data segment
;════════════════════════════════════════════════════════════════════════════
DSeg SEGMENT PUBLIC 'DataSeg'
vlmCallAddress dd 0
vlmLoaded db CR, LF, 'VLM.EXE is loaded$'
vlmNotLoaded db CR, LF, 'VLM.EXE is NOT loaded$'
redirLoaded db CR, LF, 'REDIR.VLM is loaded$'
redirNotLoaded db CR, LF, 'REDIR.VLM is NOT loaded$'
DSeg ENDS
;════════════════════════════════════════════════════════════════════════════
; CSeg - Code segment
;════════════════════════════════════════════════════════════════════════════
CSeg SEGMENT PUBLIC 'CodeSeg'
ASSUME cs: CSeg
;────────────────────────────────────────────────────────────────────────────
; @VLM_CALL - Macro used to call VLM.EXE _VLMCall dispatch procedure
;
@VLM_CALL MACRO destID, destFunc
push bp ;Save BP before we use it
mov bp, 0 ;Applications call with caller ID = 0
push bp ;Identify this overlay as the caller
mov bp, destID
push bp ;Identify the destination overlay
mov bp, destFunc
push bp ;Identify the destination function
call dword ptr vlmCallAddress
pop bp ;Restore BP
ENDM
;────────────────────────────────────────────────────────────────────────────
; StartProc - Starting point for SAMPLE program
;
StartProc proc near
ASSUME ds: nothing, es: nothing
mov ax, DSeg
mov ds, ax
ASSUME ds: DSeg
;First we need to find if VLM.EXE is loaded
mov ax, VLM_INT2F_QUERY
mov bx, GET_VLM_CALL
int 2Fh ;Returns ES:BX with entry point
or ax, ax
jz VLMIsLoaded
;VLM.EXE is not loaded so display a message and return
mov dx, OFFSET DSeg: vlmNotLoaded
mov ah, DOS_PRINT_STRING
int 21h
jmp SHORT Terminate
VLMIsLoaded:
;Save the VLM.EXE _VLMCall address
mov word ptr vlmCallAddress, bx
mov word ptr vlmCallAddress + 2, es
;Display a message indicating VLM.EXE is loaded
mov dx, OFFSET DSeg: vlmLoaded
mov ah, DOS_PRINT_STRING
int 21h
;Now lets see if REDIR.VLM is loaded
mov bx, GEN_VER
@VLM_CALL VLM_ID_REDIR, VLM_NOTIFY
or ax, ax ;If we got an error its not loaded
jz RedirIsLoaded
;REDIR.VLM is not loaded so display a message and return
mov dx, OFFSET DSeg: redirNotLoaded
mov ah, DOS_PRINT_STRING
int 21h
jmp SHORT Terminate
RedirIsLoaded:
;Display a message indicating REDIR.VLM is loaded
mov dx, OFFSET DSeg: redirLoaded
mov ah, DOS_PRINT_STRING
int 21h
Terminate:
mov ah, DOS_TERMINATE ;Terminate the application
int 21h
StartProc endp
CSeg ENDS
END StartProc
;════════════════════════════════════════════════════════════════════════════
; SAMPLE.ASM
;════════════════════════════════════════════════════════════════════════════